<!--  -->
<template>
  <div>
    <van-nav-bar title="我的拼团" left-text="返回" left-arrow />
<van-tabs v-model="active" animated>
 <van-tab title="全部">
        <van-card v-for="(item) in order" :key="item.groupId" :num="item.groupNowNum" :price="item.goods.goodsPrice" :desc="item.goods.goodsDesc" :title="item.goods.goodsName" :thumb="item.goods.goodsImg">
  <template #tags>
    
    <van-tag v-if="item.groupStatus==0 " plain type="danger">拼团中</van-tag>
    <van-tag v-if="item.groupStatus==1 " plain type="danger">已完成</van-tag>
    <van-tag v-if="item.groupStatus==2 " plain type="danger">拼团失败</van-tag>
  </template>
  <template #footer>
    <van-button size="mini" @click="go(item.orderId,item.userId,item.goods.goodsId)">评价</van-button>
  </template>
        </van-card>
 </van-tab>
    <van-tab title="拼团中">
     
       <van-card  v-for="(item) in order" :key="item.groupId"  v-if="item.groupStatus==0" :num="item.groupNowNum" :price="item.goods.goodsPrice" :desc="item.goods.goodsDesc" :title="item.goods.goodsName" :thumb="item.goods.goodsImg">
  <template #tags>
    
    <van-tag v-if="item.groupStatus==0" plain type="danger">拼团中</van-tag>
    
  </template>
  <template #footer>
    <van-button size="mini" @click="go(item.orderId,item.userId,item.goods.goodsId)">评价</van-button>
  </template>
        </van-card>
        
 </van-tab>

  <van-tab title="已完成">
          <van-card v-for="(item) in order" :key="item.groupId"  v-if="item.groupStatus==1"  :num="item.groupNowNum" :price="item.goods.goodsPrice" :desc="item.goods.goodsDesc" :title="item.goods.goodsName" :thumb="item.goods.goodsImg">
  <template #tags>
    
   
    <van-tag v-if="item.groupStatus==1" plain type="danger">已完成</van-tag>
   
  </template>
  <template #footer>
    <van-button size="mini" @click="go(item.orderId,item.userId,item.goods.goodsId)">评价</van-button>
  </template>
        </van-card>
  </van-tab>
  <van-tab title="拼团失败">
      <van-card v-for="(item) in order" :key="item.groupId"  v-if="item.groupStatus==2"  :num="item.groupNowNum" :price="item.goods.goodsPrice" :desc="item.goods.goodsDesc" :title="item.goods.goodsName" :thumb="item.goods.goodsImg">
  <template #tags>
    
   
    <van-tag v-if="item.groupStatus==2 " plain type="danger">拼团失败</van-tag>
  </template>
  <template #footer>
    <van-button size="mini" @click="go(item.orderId,item.userId,item.goods.goodsId)">评价</van-button>
  </template>
        </van-card>
  </van-tab>
  
</van-tabs>

  </div>
</template>

<script>
export default {
name : 'ptshare',
data(){
    return {
      userId:1,
      //全部列表
      order:{},
      // 拼团中
        evaluate:{},
       //已完成
      Receiving_goods:{},
        //拼团失败
      deliver_goods:{},
      payment:{},
     
        active:'',
       
    }
},
methods:{
  
  
},


created(){
    let sess = JSON.parse(sessionStorage.getItem("user"))

  //全部
  this.$axios.post('/api/markerGroup/getGroupList?userId='+sess.userId).then((res)=>{
    this.order=res.data.data
    console.log(res.data.data)
  }).catch((err)=>{console.log("失败")})

  
}

  }
</script>

<style  scoped>

</style>
